/*
 * jPOS' miniSpace
 * Copyright (C) 2000-2006 Alejandro Revilla
 * jPOS.org (http://jpos.org)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301
 * USA
 *
 */

package org.jpos.space;

import java.util.Set;

/**
 * @author Kris, Bharavi, Alejandro
 * @version $Revision: 2087 $ $Date: 2004-12-17 17:37:40 -0300 (Fri, 17 Dec 2004) $
 */
public interface LocalSpace extends Space {
    /**
     * add a SpaceListener associated with a given key
     * @param key Entry's key
     * @param listener a SpaceListener
     */
    public void addListener    (Object key, SpaceListener listener);

    /**
     * add a SpaceListener associated with a given key for a given 
     * period of time.
     * <b>Warning: not supported by all space implementations.</b>
     * @param key Entry's key
     * @param listener a SpaceListener
     * @param timeout 
     */
    public void addListener (Object key, SpaceListener listener, long timeout);

    /**
     * removes a SpaceListener associated with a given key
     * @param key Entry's key
     * @param listener the SpaceListener
     */
    public void removeListener (Object key, SpaceListener listener);

    /**
     * @return Set containing all keys in Space
     */
    public Set getKeySet ();

    /**
     * @return number of entries in a given key
     */
    public int size (Object key);
}

